package com.zjkj.mp.service.customer.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zjkj.mp.dao.customer.GroupDao;
import com.zjkj.mp.service.customer.GroupService;
import com.zjkj.mp.utils.PaginatedResult;
import com.zjkj.mp.vo.customer.Group;

@Service
@Transactional(rollbackFor=Exception.class)
public class GroupServiceImpl implements GroupService {

	@Resource(name="groupDaoImpl")
	GroupDao groupDao;

	public List<Group> getGroupList(int groupId) {
		List<Group> list = null;
		if(groupId==0||"".equals(groupId)){
			list = groupDao.getGroupList();
		} else {
			list = groupDao.getGroupList(groupId);
		}
		return list;
	}

	public int insertGroup(Group group) {
		return groupDao.insertGroup(group);
	}

	public int delGroup(int groupId) {
		return groupDao.delGroup(groupId);
	}

	public int updGroup(Group group) {
		return groupDao.updGroup(group);
	}

	@Override
	public PaginatedResult getGroupPageList(int nowPage, int maxRow,
			Map<String, Object> map) {
		return groupDao.getGroupPageList(nowPage, maxRow, map);
	}

}
